package com.hhz.mp;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.hhz.mp.injector.MyInjector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;


@SpringBootApplication
public class MpApplication {

    public static void main(String[] args) {
        SpringApplication.run(MpApplication.class, args);
    }


    /**
     * 配置乐观锁
     *
     * @return
     */
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }

    /**
     * 自定义SQL注入器
     *
     * @return
     */
    @Bean
    public MyInjector mySqlInjector() {
        return new MyInjector();
    }

}
